from hitbtc.HitbtcAPI import *
import json

url = "https://api.hitbtc.com"
def GetCoinNum(coinjson, ak, sk):
    bfc = Client(url, ak, sk)
    coins = bfc.get_account_balance()
    print(coins)
    #myCoins = coins['balances']
    for i in coins:
        num = (float)(i['available'])
        if num > 0:
            if i['currency'].lower() in coinjson.keys():
                coinjson[i['currency'].lower()] = coinjson[i['currency'].lower()] + num
            else:
                coinjson[i['currency'].lower()] = num

if __name__ == '__main__':
    GetCoinNum(json.loads('{}'), "5055242614560969b422a5bc9ab54426", "9c370195a626609443018386b35aed9f")